using Microsoft.Data.SqlClient;
using SqlSugar;

namespace KrigingTest;

public class SqlSugarHelper
{
    public static SqlSugarClient AhnwDb()
    {
        var connectionString = ConfigHelper.GetConfigValue("DbConnection:DefaultDb");
        
        new SqlConnection(connectionString).Open();
        
        // 初始化SqlSugarClient
        return new SqlSugarClient(new ConnectionConfig
        {
            ConnectionString = connectionString,
            DbType = DbType.SqlServer,
            IsAutoCloseConnection = true,
        });
    }
}